package com.example.day08;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class StringTest01 {
    public static void main(String[] args) {
        String username ="itheima";
        String password ="czbk";
        for (int i = 0; i < 3; i++){
            Scanner sc =new Scanner(System.in);
            System.out.println("请输入用户名：");
            String name =sc.nextline();
            System.out.println("请输入密码：");
            String pwd =sc.nextline();
            if(username.equals(name)&&password.equals(pwd)){
                System.out.println("登录成功");
                break;
            }else {
                if (2-i==0){
                    System.out.println("登录失败");
                }else {
                System.out.println("用户名或密码错误，请重新输入");
            }
        }
    }
}
